home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wfc007.000 / test / tcras.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-08  |  1.5 KB  |  72 lines

  1. #include "test.h"
  2. #pragma hdrstop
  3.  
  4. void test_CRAS( void )
  5. {
  6.    CRAS ras;
  7.  
  8.    CStringArray strings;
  9.  
  10.    if ( ras.GetPhoneBookEntries( strings ) == TRUE )
  11.    {
  12.       DWORD index = 0;
  13.       DWORD number_of_entries = strings.GetSize();
  14.  
  15.       TRACE( "Phone Book Entries:\n" );
  16.  
  17.       while( index < number_of_entries )
  18.       {
  19.          TRACE1( "\"%s\"\n", (const char *) strings[ index ] );
  20.          index++;
  21.       }
  22.    }
  23.  
  24.    strings.RemoveAll();
  25.  
  26.    if ( ras.GetConnections( strings ) == TRUE )
  27.    {
  28.       DWORD index = 0;
  29.       DWORD number_of_entries = strings.GetSize();
  30.  
  31.       TRACE( "\nCurrent Connections:\n" );
  32.  
  33.       while( index < number_of_entries )
  34.       {
  35.          TRACE1( "\"%s\"\n", (const char *) strings[ index ] );
  36.          index++;
  37.       }
  38.    }
  39.  
  40.    if ( ras.Open( "Cheetah2" ) != TRUE )
  41.    {
  42.       CString error_string;
  43.       ras.GetErrorString( error_string );
  44.       TRACE1( "Ras Open failed with \"%s\"!\n", (const char *) error_string );
  45.    }
  46.    else
  47.    {
  48.       TRACE( "RAS Open!\n" );
  49.    }
  50.  
  51.    strings.RemoveAll();
  52.  
  53.    if ( ras.GetConnections( strings ) == TRUE )
  54.    {
  55.       DWORD index = 0;
  56.       DWORD number_of_entries = strings.GetSize();
  57.  
  58.       TRACE( "\nCurrent Connections:\n" );
  59.  
  60.       while( index < number_of_entries )
  61.       {
  62.          TRACE1( "\"%s\"\n", (const char *) strings[ index ] );
  63.          index++;
  64.       }
  65.    }
  66.  
  67.    if ( ras.HangUp( "cheetah2" ) == TRUE )
  68.    {
  69.       TRACE( "Hangup OK\n" );
  70.    }
  71. }
  72.